package com.lebo.portal.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.lebo.portal.view.PageQuery;
import com.lebo.portal.view.PageResult;

@Service
public abstract class BaseService {
    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    protected <T,V> PageResult<T> processResult(T value, PageQuery<V> pageQuery, Long totalItem) {
        PageResult<T> result = new PageResult<T>();
        result.setInfo(value);
        result.setPageInfo(pageQuery.getPageInfo());
        result.getPageInfo().setTotalItem(totalItem);
        return result;
    }
}
